package com.neutech.neupha.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.neutech.neupha.service.DrugService;
import com.neutech.po.Drug;

@RestController
@RequestMapping("/drugmage")
public class DrugController {
	@Autowired
	private DrugService drugService;
	@RequestMapping(value="addNewDrug",method=RequestMethod.POST)
	public String addNewDrug(@RequestBody Map<String,Object> drug){
		System.out.println(drug.get("drugsName"));
		int result = drugService.addNewDrug(drug);
		if(result>0){
			return "成功";
		}else{
			return "失败";
		}
	}
}
